<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

/**
 * 测试签名参数
 * timestamp: 1568959879
 * signature: 786642584e178a0372c4c74585fdce7d67848bb4
 */
Route::namespace('Api')->middleware('signature')->group(function () {
    Route::get('/index', 'IndexController@index');
    Route::post('/sign_up', 'AuthController@signUp');
    Route::post('/auth_code', 'AuthController@loginByCode');
    Route::post('/auth_social', 'AuthController@loginBySocial');
    Route::post('/auth_password', 'AuthController@loginByPassword');
    Route::put('/reset_password', 'ResetPasswordController@update');
    Route::post('/verification_codes', 'VerificationCodesController@store')->middleware('api.throttle:5,1');;
    Route::middleware('auth:api')->group(function () {
        Route::get('/logout', 'AuthController@logout');
        Route::get('/refresh_token', 'AuthController@refreshToken');
        Route::post('payment/pay', 'PaymentsController@pay');
    });



    //制作分类页面的接口
    Route::get('/cat','CatController@cat');
});
